import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// 补充 nodejs 的类型 -> npm i @types/node -D
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "@/styles/variables.scss";`,
      },
    },
  },
  // 路由别名
  // 问题：书写路径没有提示
  // 解决：tsconfig.json中补充路径提示
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
});
